/******************************************************************************
 * 全站通用的基本樣式表
 *
 * - 盡可能支援所有瀏覽器，如避免用 :not()
 *****************************************************************************/

html {
  height: 100%;
  line-height: 2;
}

body {
  margin: 0;
  padding: 0;
}

body > .main {
  margin: 1.7em;
}

.main > header > h1 {
  margin: 1rem 0;
  border-bottom: double #a2a9b1;
  font-size: 1.8em;
}

.main > footer {
  margin-top: 2rem;
  padding: .5rem;
  background-color: #E9E9E9;
}

.main h1,
.main h2 {
  border-bottom: 1px solid #a2a9b1;
}

.main h1,
.main h2,
.main h3,
.main h4,
.main h5,
.main h6 {
  margin: 2rem 0 1rem 0;
}

.main h1 {
  font-size: 1.67em;
}

.main h2 {
  font-size: 1.5em;
}

.main h3 {
  font-size: 1.4em;
}

.main h4 {
  font-size: 1.3em;
}

.main h5 {
  font-size: 1.2em;
}

.main h6 {
  font-size: 1.1em;
}

.main table {
  line-height: 1.5;
}

strong {
  color: red;
}

code {
  background-color: #EEE;
  padding: 1px 3px;
  color: #222;
}

pre > code {
  background-color: initial;
  padding: initial;
  color: initial;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #F33;
}

cite:lang(zh-hant) {
  font-style: normal;
  text-decoration: underline wavy;
}

/**
 * 主要佈局相關元素
 */
#page-header {
  display: block;
  background-color: #E9E9E9;
}

#page-header > h1 {
  margin: 0;
  padding: .75rem;
  text-align: center;
  font-size: 1.25em;
  color: #333;
  text-shadow: 0px 1px 0px #EEE;
}

#page-header > h1 {
  margin: 0 2em; /* 留邊距避免與工具欄按鈕重疊 */
}

#page-header > h1 a {
  color: black;
}

#page-header > h1 a:hover {
  color: #F33;
}

#page-header > nav ul {
  margin: auto;
  padding: 0;
  background-color: #dfd;
}

#page-header > nav ul > li {
  display: inline-block;
  list-style: none;
  box-sizing: border-box;
  margin: auto;
}

#page-header > nav ul > li > a {
  padding: 0.5em;
}

#page-header > nav ul > li > a:hover {
  background-color: #5e7380;
  color: #fff;
  text-decoration: none;
}

#page-footer {
  padding: .75em;
  background-color: #E9E9E9;
  color: #333;
  font-size: .75em;
  text-align: center;
}

/**
 * 列印樣式
 */
@media print {
  html {
    line-height: 1.75;
  }

  figure {
    page-break-inside: avoid; /* legacy */
    break-inside: avoid;
  }

  a {
    color: unset;
    text-decoration: underline;
  }
}
